#ifndef EVENT_H_
#define EVENT_H_

#include "SDL/SDL.h"
#include "../common/Constantes.h"
#include "../common/utils/Logger.h"
#include <string>
#include "../common/DTOEvent.h"
#include "../common/DTOCliente.h"
#include "../common/DTOShipStatus.h"

enum EventType {
	Quit = SDL_QUIT,
	KeyPressed = SDL_KEYDOWN,
	KeyReleased = SDL_KEYUP,
	MouseButtonPressed = SDL_MOUSEBUTTONDOWN,
	MouseButtonReleased = SDL_MOUSEBUTTONUP,
	UserEvent = SDL_USEREVENT,
	Resize = SDL_VIDEORESIZE,
	MouseMotion = SDL_MOUSEMOTION,
	NewUser = 22,
	Ship_Status = 23
};

enum EventKey {
	Escape = SDLK_ESCAPE,
	Backspace = SDLK_BACKSPACE,
	Space = SDLK_SPACE,
	KeyDown = SDLK_DOWN,
	KeyUp = SDLK_UP,
	KeyLeft = SDLK_LEFT,
	KeyRight = SDLK_RIGHT,
	KeyA = SDLK_a,
	KeyZ = SDLK_z,
	Delete = SDLK_DELETE
};

enum EventButtonState {
	Pressed = SDL_PRESSED
};

class Event {
public:
	Event(SDL_Event event);

	Event(DTOShipStatus* dtoShip);

	Event(DTOCliente* dtoClient);

	Event(DTOEvent* dtoEvent);

	virtual ~Event();

	/* Setea el evento con la informacion del evento SDL. */
	virtual void setEvent(SDL_Event event);

	virtual void setSender(std::string sender);

	SDL_Event* getEvent();

	virtual EventType getType();

	virtual EventKey getKey();

	virtual EventButtonState getButtonState();

	virtual WindowID getCode();

	std::string getData();

	std::string getData2();

	int getintData2();

	virtual Uint16 getKeyUnicode();

	virtual Uint16 getXCoordinate();

	virtual Uint16 getYCoordinate();
	//virtual std::string toString();

	virtual Uint16 getW();

	virtual Uint16 getH();

	void eraseData();

	DTOEvent* transformInDTO();
	DTOShipStatus* transformInDTOShipStatus();

	std::string getSender();

private:
	SDL_Event event;
	std::string sender;

	Event();
};

#endif /* EVENT_H_ */
